package ControlLayer;

import ModelLayer.*;
/**
 * Write a description of class PersonControls here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class PersonControls
{
    private PersonContainer personCont;
    
    public PersonControls()
    {
        personCont = PersonContainer.getInstance();
    }
    
    public void createPersons(String name, String address, String postalCode, String city, String phone, String id)
    {
        Person personObject = new Person(name, address, postalCode, city, phone, id);
        personCont.addPersons(personObject);
    }
    
    public void createObjects()
    {
        personCont.addPersons(new Person("John", "Aalborg", "9000", "Aalborg", "1234567890", "123456"));
        personCont.addPersons(new Person("Peter", "Aarhus", "6000", "Aarhus", "1234567891", "567890"));
    }
    
    public String addResult()
    {
        return personCont.addResult();
    }
       
    public String showPersons(String id)
    {
        return personCont.showPersons(id);
    }
    
    public void deletePersons(String id)
    {
        personCont.deletePersons(id);
    }
    
    public String returnResult()
    {
        return personCont.deleteResult();
    }
    
    public void updatePersons(String newName, String newAddress, String newPostalCode, String newCity, String newPhone, String oldId )
    {
        personCont.updatePersons(newName, newAddress, newPostalCode, newCity, newPhone, oldId);
    }    
}
